package org.ehe.erp.domain.quality.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.ehe.common.mybatis.core.domain.BaseEntity2;
import org.ehe.erp.domain.quality.ErpQualityItem;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

/**
 * 质检项目业务对象
 *
 * @author zhangnn
 * @className ErpQualityItemBo
 * @description 质检项目BO，用于业务逻辑处理
 * @date 2025-09-10 15:00:00
 */
@Data
@AutoMapper(target = ErpQualityItem.class, reverseConvertGenerate = false)
public class ErpQualityItemBo extends BaseEntity2 {

    private Long id;

    @NotBlank(message = "质检项目编码不能为空")
    @Length(max = 100, message = "质检项目编码长度不能超过100字符")
    private String itemCode;

    @NotBlank(message = "质检项目名称不能为空")
    @Length(max = 255, message = "质检项目名称长度不能超过255字符")
    private String itemName;

    @Length(max = 100, message = "质检分类长度不能超过100字符")
    private String category;

    @Length(max = 2000, message = "质检标准描述长度不能超过2000字符")
    private String standard;

    @Length(max = 500, message = "检验方法长度不能超过500字符")
    private String checkMethod;

    @Range(min = 0, max = 1, message = "是否必检项值必须为0或1")
    private Integer isRequired = 1;

    private Integer sort = 0;

    @NotNull(message = "状态不能为空")
    @Range(min = 0, max = 1, message = "状态值必须为0或1")
    private Integer status = 1;
}
